﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DicTextBoxSelector.ascx.cs" ClassName="DicTextBoxSelector" Inherits="Hxsoft.AppV1._Controls.DicTextBoxSelector" %>
<span id="<%= this.ClientID %>">
<asp:TextBox ID="CtrSelectorValue" runat="server"></asp:TextBox>
<ul id="<%= this.ClientID %>_PopupSelector" class="DicTextBoxSelectorListBox">
	<asp:Repeater ID="CtrList" runat="server" ondatabinding="CtrList_DataBinding">
		<ItemTemplate>
			<li><a href="javascript:<%= this.ClientID %>_SelectItem('<%# Eval(DataValueField) %>');"><%# Eval("Name") %></a></li>
		</ItemTemplate>
	</asp:Repeater>
</ul>
</span>

<script type="text/javascript">
function <%= this.ClientID %>_SelectItem(value)
{
	$("#<%= CtrSelectorValue.ClientID %>").val(value);
	$("#<%= this.ClientID %>_PopupSelector").css("display", "none");
}

function <%= this.ClientID %>_Init() {
	$("#<%= CtrSelectorValue.ClientID %>").popupElement({popupElement : "#<%= this.ClientID %>_PopupSelector"});
}
</script>